package com.circle.rest.core.util;

import com.circle.rest.core.common.enums.BusinessStatus;
import com.circle.rest.core.common.enums.BusinessType;
import com.circle.rest.core.common.enums.OperatorType;

/**
 * @program: 200221000010675
 * @description: 常量转换工具类
 * @author: 赵航
 * @create: 2019-04-04 09:53
 **/
public class ConstantUtil {

    /**
     * 日志业务类型
     *
     * @param businessType
     * @return
     */
    public static String getBusinessTypeName(Object businessType) {
        if (ToolUtil.isNotEmpty(businessType)) {
            return BusinessType.valueOf((Integer) businessType);
        }
        return "--";
    }

    /**
     * 日志状态
     *
     * @param status
     * @return
     */
    public static String getBusinessStatusName(Object status) {
        if (ToolUtil.isNotEmpty(status)) {
            return BusinessStatus.valueOf((Integer) status);
        }
        return "--";
    }

    /**
     * 操作类别
     *
     * @param operatorType
     * @return
     */
    public static String getOperatorTypeName(Object operatorType) {
        if (ToolUtil.isNotEmpty(operatorType)) {
            return OperatorType.valueOf((Integer) operatorType);
        }
        return "--";
    }
}
